package com.zj.ssm.controller;


import com.alibaba.druid.sql.dialect.mysql.visitor.MySqlShowColumnOutpuVisitor;
import com.aliyuncs.ecs.model.v20140526.DescribeBandwidthPackagesResponse;
import com.zj.ssm.pojo.domain.Admin;
import com.zj.ssm.pojo.domain.query.NewsQuery;
import com.zj.ssm.pojo.domain.vo.NewsVO;
import com.zj.ssm.pojo.domain.query.NewsQuery;
import com.zj.ssm.pojo.domain.vo.NewsVO;
import com.zj.ssm.result.AjaxResult;
import com.zj.ssm.service.NewsService;
import com.zj.ssm.sysconst.LoginConst;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * @author wxr
 * @version 1.0
 * @date 2022/1/7 10:29
 */
@RestController
@RequestMapping("news")
public class NewsController {
    @Autowired
    private NewsService newsService;


/*   新闻审批  搜索查看 */
    @RequestMapping("query")
    public AjaxResult query(NewsQuery query){
        return newsService.queryNews(query);
    }


/*   添加新闻 **/
    @RequestMapping("addNews")
    public AjaxResult addNews(NewsVO newsVO){

        return newsService.addNews(newsVO);
    }

/*    新闻审批  新闻上下线  详情按钮获取id*/
    @RequestMapping("get/{id}")
    public AjaxResult get(@PathVariable("id") Integer id){

        return newsService.getNews(id);
    }

    @RequestMapping("show")
    public AjaxResult show(){

        return newsService.show();
    }



//    /*    新闻 评论按钮*/
//    @RequestMapping("comment")
//    public AjaxResult comment(String username,String password){
//        return newsService.login(username,password);
//    }


    /*    新闻审批  通过按钮*/




}
